package com.oweight.sagacious.auth.server.domain.service;

import com.oweight.sagacious.auth.server.domain.repo.ClientRepository;
import com.oweight.sagacious.auth.server.infrastructure.util.user.JwtAuthenticationRequest;
import com.oweight.sagacious.auth.server.infrastructure.util.user.WeChatLoginForm;
import com.oweight.sagacious.common.domain.service.IBaseManager;

/**
 * @author 周广明
 * @version v1 2019/10/30 14:25
 */
public interface IClientManager extends IBaseManager<ClientRepository> {

    /**
     * 远程登录
     *
     * @param authenticationRequest
     * @return
     * @throws Exception
     */
    String login(JwtAuthenticationRequest authenticationRequest) throws Exception;

    /**
     * 远程登录（微信）
     *
     * @param form
     * @return
     * @throws Exception
     */
    String login2(WeChatLoginForm form) throws Exception;

    /**
     * 刷新Token
     *
     * @param oldToken
     * @return
     * @throws Exception
     */
    String refresh(String oldToken) throws Exception;

    /**
     * 检验Token
     *
     * @param token
     * @throws Exception
     */
    void validate(String token) throws Exception;
}
